<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\web\View;
use yii\widgets\LinkPager;
use yii\base\Widget;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$search='';
$this->title='';
$this->params['breadcrumbs'][] = $this->title;
$this->registerCssFile('/css/pay.css');
$this->registerJs("$('.type-box .type-con').click(function(){
			$('.type-box .type-con').removeClass('sel-con');
			$(this).addClass('sel-con');
		});");
$this->registerJs("
		function goPay(){
			var type = $('.sel-con').attr('data-type');
			MUSTPAY.init({
				'apps_id': '{$apps_id}', 	//MustPay系统分配的应用ID号
	            'prepay_id': '{$prepayId}', //商户通过统一下单接口获取的预支付ID
	            'pay_type': type //支付通道简称
			});
		}", View::POS_BEGIN);
$this->registerJsFile('/js/footer.js');
$this->registerJsFile('https://www.mustpay.com.cn/service/js/pcsdk.js', [
    'position' => View::POS_END
]);
$params = Yii::$app->view->params;
?>
	<div class="pay-box">
	<div class='her'>订单支付</div>
		<div class="goods-name">
			<table border='0' cellpadding='0' cellspacing='0'>
			<tr>
				<td>商品图</td>
				<td>标题</td>
				<td>单价</td>
				<td>数量</td>
				<td>合计</td>
			</tr>
			<?php if(!empty($info)):?>
			<?php foreach($info as $val):?>
			<tr>
				<td><img src='<?=$val['logo']?>'></td>
				<td><?=$val['name']?></td>
				<td><?=$val['price']?></td>
				<td><?=$val['num']?>/把</td>
				<td><?=sprintf("%.2f",$val['num']*$val['price'])?></td>
			</tr>
			<?php endforeach;?>
			<?php endif;?>
			</table>
		</div>
		<div class="goods-price">
			合计：<?=$order->price?>元
		</div>
		<div class="type-box">
			<div class="type-con sel-con" data-type="ali_pay_pc">
				<img src="https://www.mustpay.com.cn/testpay/images/zhifubao.png" height="25px">
				<span>支付宝支付</span>
			</div>
			<div class="type-con" data-type="wx_pay_pc">
				<img src="https://www.mustpay.com.cn/testpay/images/weixin.png" height="25px">
				<span>微信支付</span>
			</div>
			<div class="type-con" data-type="union_pay_pc">
				<img src="https://www.mustpay.com.cn/testpay/images/yinlian.png" height="25px">
				<span>银联支付</span>
			</div>
		</div>
		<div class="sub-btn" onclick="goPay();">去支付</div>
		<div style="clear:both;"></div>
	</div>
	